<?php

/**
 * @name MockController
 * @desc 控制器
 */
class MockController extends \Yaf\Controller_Abstract {

    /**
     * 默认动作
     */
    public function indexAction()
    {
        echo "Hello passport";
        return false;
    }

    public function payAction() {
        $oder_no = $_GET['order_no'];
        $orderInfo = OrderModel::getSingleton()->find(['order_no'=> $oder_no]);
        $curTime = time();
        $data = [
            'status'    => 1,
            'pay_type'  => 1,
            'pay_money' => $orderInfo['total_money'],
            'pay_time'  => $curTime,
            'pay_time_end'  => $curTime
        ];
        if(!OrderModel::getSingleton()->update(['order_no'=> $oder_no], $data)){
            echo '支付失败';
            exit;
        }
        echo '支付成功';
        exit;
    }

}
